#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
________________________________________________
 @Time    : 2018/6/6 下午1:12
 @Author  : NickTet
 @Site    : 
 @File    : Main.py
 @Software: PyCharm
 _______________________________________________
 """
import sys
from multiprocessing import Process

sys.path.append("../")
from Api.ProxyApi import run as ProxyApiRun
from Schedule.ProxyValidSchedule import run as ValidRun
from Schedule.ProxyRefreshSchedule import run as RefreshRun


def run():
    p_list = list()
    p1 = Process(target=ProxyApiRun, name="ProxyApiRun")
    p_list.append(p1)

    p2 = Process(target=ValidRun, name='ValidRun')
    p_list.append(p2)

    p3 = Process(target=RefreshRun, name='RefreshRun')
    p_list.append(p3)

    for p in p_list:
        p.daemon = True
        p.start()
    for p in p_list:
        p.join()


if __name__ == '__main__':
    run()
